import streamlit as st

st.button("ok",key="ok1",on_click=lambda:st.write("ok1"))
st.button("ok",key="ok2",on_click=lambda:st.write("ok2"))

if "min_age" not in st.session_state:
    st.session_state.min_age = 0
    min_age = st.session_state.min_age
else:
    min_age = st.session_state.min_age

if "max_age" not in st.session_state:
    st.session_state.max_age = 0
    max_age = 0
else:
    max_age = st.session_state.max_age

min_age = st.slider("Select a min age",min_value=0,max_value=100,value=min_age)
age_range = st.slider("age range:",min_value=min_age,max_value=100,value=max_age)

st.session_state.min_age = min_age
st.session_state.max_age = age_range

if "name" not in st.session_state:
    st.session_state.name = ""
if st.checkbox("Show name input"):
    name = st.text_input("Name",value=st.session_state.name)
    st.session_state.name = name
    if st.button("Show name"):
        st.write("Name is ",name)
